package com.learnboy.config;

import org.springframework.beans.factory.FactoryBean;

/**
 * MyFactoryBean
 *
 * @author: cyx_jay
 * @date: 2021/2/2 10:22
 */
public class MyFactoryBean<T> implements FactoryBean {
    private T t;

    @Override
    public boolean isSingleton() {
        return true;
    }

    @Override
    public T getObject() throws Exception {
        //动态代理即可
        return null;
    }

    @Override
    public Class<?> getObjectType() {
        return t.getClass();
    }

    public MyFactoryBean(T t) {
        this.t = t;
    }

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }
}
